package gwtgaetools.client.ui;

import gwtgaetools.client.ItemManager;
import gwtgaetools.client.listeners.Listener;

import com.google.gwt.user.client.ui.HTML;

public class SmartHTML<T> extends HTML implements Listener<ItemManager<T>> {

	public SmartHTML(ItemManager<T> t, boolean b) {
		super("");
		t.registerListener(this, b);
	}
	
	public SmartHTML() {}

	public SmartHTML(ItemManager<T> t){
		this(t, false);
	}

	@Override
	public void observe(ItemManager<T> t) {
		if (t.getItem()!=null)
			setHTML(t.getItem().toString());
	}

}
